#include "vertex_types.fxh"
#include "Samplers.fxh"
#include "globals.fxh"


T2TEXTURED_VERTEX_PS RenderVS(TNORMAL_COLORED_2TEXTURED_VERTEX_VS IN)
{
	T2TEXTURED_VERTEX_PS OUT=(T2TEXTURED_VERTEX_PS)0;
    OUT.HPosition=mul(float4(IN.Position,1.0),g_WorldViewProjectionMatrix);
    OUT.UV=IN.UV;
	OUT.UV2=IN.UV2;
    return OUT;
}

float4 RenderPS(T2TEXTURED_VERTEX_PS IN) : COLOR
{
	float4 l_tex= tex2D(S0LinearSampler, IN.UV);
	float4 l_LightMap= 2*tex2D(S1LinearSampler, IN.UV2);
	
	return l_tex*l_LightMap;
}


technique tecLightMap
{
	pass p0 
	{
		CullMode = None;
		VertexShader = compile vs_3_0 RenderVS();
		PixelShader = compile ps_3_0 RenderPS();
	}
}